// pages/homework-evaluate-student/homework-evaluate-student.ts
interface tempFiles {
  tempFilePath: String,
  size: number,
  fileType: String,
}
Page({
  /**
   * 页面的初始数据
   */
  data: {
    selectIndex: -1,
    uploadImg: [] as tempFiles[],
    emotionArr: [
      {
        'emotionId': 1,
        "url": '/images/homework-evaluate-bad-icon.svg',
        "selectedUrl": "/images/homework-evaluate-bad-selected-icon.svg"
      },
      {
        'emotionId': 2,
        "url": '/images/homework-evaluate-subpar-icon.svg',
        "selectedUrl": "/images/homework-evaluate-subpar-selected-icon.svg"
      },
      {
        'emotionId': 3,
        "url": '/images/homework-evaluate-normal-icon.svg',
        "selectedUrl": "/images/homework-evaluate-normal-selected-icon.svg"
      },
      {
        'emotionId': 4,
        "url": '/images/homework-evaluate-good-icon.svg',
        "selectedUrl": "/images/homework-evaluate-good-selected-icon.svg"
      },
      {
        'emotionId': 5,
        "url": '/images/homework-evaluate-great-icon.svg',
        "selectedUrl": "/images/homework-evaluate-great-selected-icon.svg"
      },
    ],
  },
  handleUplaod() {
    wx.chooseMedia({
      success: (res) => {
        const { tempFiles } = res
        this.setData({
          uploadImg: tempFiles
        })
      }
    })
  },
  handleSelect(e: any) {
    const { index } = e.currentTarget.dataset;
    this.setData({
      selectIndex: index
    })
  },
  handleCancle() {
    this.setData({
      uploadImg: []
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})